package com.shoesmail.domain.vo;

import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author ：CDB
 * @description：分页
 * @date ：2025/9/19 10:31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
    private long total;
    private int pages;
    private int pageNum;
    private int pageSize;
    private List<T> list;

    public <P> PageResult(PageInfo<P> pageInfo,List<T> list) {
        this.total = pageInfo.getTotal();
        this.pages = pageInfo.getPages();
        this.pageNum = pageInfo.getPageNum();
        this.pageSize  = pageInfo.getPageSize();
        this.list = list;
    }
}










